package one;

public class GenericDemo {
    public static void main(String[] args) {
        Person<String> person = new Person<>();
        person.setElement("张飞");
        //person.setElement(12);//报错
        System.out.println(person.getElement());
    }
}
class Person<E>{
    private E element;

    public E getElement() {
        return element;
    }

    public void setElement(E element) {
        this.element = element;
    }

}
